package com.spring.shops.dao;

import com.github.pagehelper.Page;
import com.spring.shops.model.entity.TzProd;
import com.spring.shops.model.entity.TzProdWithBLOBs;
import com.spring.shops.model.dto.ProdDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface TzProdMapper {
    int deleteByPrimaryKey(Long prodId);

    int insert(TzProdWithBLOBs record);

    int insertSelective(TzProdWithBLOBs record);

    TzProdWithBLOBs selectByPrimaryKey(Long prodId);

    int updateByPrimaryKeySelective(TzProdWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(TzProdWithBLOBs record);

    int updateByPrimaryKey(TzProd record);
    /**
     * 产品分页查询
     * @param dto
     * @return
     */
    Page<TzProd> page(ProdDTO dto);

    /**
     * g根据id查询数据
     * @param prodId
     * @return
     */
    @Select("select * from yami_shops.tz_prod where prod_id=#{prodId}")
    TzProd selectById(Long prodId);

    int save(TzProd tzProd);

    /**
     * 根据产品id获取信息
     * @param prodId
     * @return
     */
    @Select("select * from yami_shops.tz_prod where prod_id=#{prodId}")
    TzProd getById(Integer prodId);
}